﻿using DC2010.Objects;
using DC2010.Objects.Base;
using DC2010.Objects.Data;

namespace DC2010.Conditions
{
    public class C_CanJoinParty : ConditionLogic
    {
        public C_CanJoinParty(ConditionData cd)
            : base(cd)
        {
            ShortName = "Is item in right hand";
            LongName = "Checks if item is in right hand.";
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="aInvoker">Creature which want to join party</param>
        /// <param name="aTarget">Party that a2 wishes to join</param>
        public override bool CheckCondition(BaseObject aInvoker, BaseObject aTarget)
        {
            if ((aTarget is PartyData) && (aInvoker is CreatureData))
            {
                HandleEffects(true, aInvoker, aTarget);
                return true;
            }

            return false;
        }
    }
}
